SE 423 Final Project

Group 74 (2)

Objective

Devise an algorithm to command an autonomous robot vehicle to travel to five predetermined locations, kill five weeds of either color (blue and pink), and then report the number of weeds killed in designated locations. The robot must be able to travel through a course while avoiding hitting obstacles. Additionally, the robot must be able to recognize the color of the weeds and report the number of weeds in the zone corresponding to the weeds¡¯ color. Information about the course such as location of the obstacles and weeds are to be displayed in LabVIEW.

 

 

Path Planning

We used the A* algorithm to design a path for the robot to traverse the course to the various way points. As the robot moves through the course, obstacles are detected and the course map is updated. We created an array of potential obstacles and when the LADAR sensor detects a point that is close to a possible obstacle, that obstacle is marked in the map. Depending on the location of the robot relative to the obstacle wall, we predicted the entire obstacle box and marked the additional walls.  A* is called again with the updated map and is able to create a path that avoids the new obstacles. Additionally, we used heuristics that are different from the homework problem. Instead of Manhattan distance, we used Euclidean distance as heuristic, which gave us better path in some circumstances.

LabVIEW

LabVIEW was used to record the path of the robot, the obstacle locations, and the weeds¡¯ color and corresponding position. The robot¡¯s path is constantly being updated, and the weed color and position is updated when the robot camera detects a weed which hasn¡¯t been detected . The wall will be sent to labview only when it¡¯s first been detected by LADAR. To make sure the labview picture doesn¡¯t keep drawing wall and weed, we created an array for weed and wall separately to keep track whether the wall/weed at current index has been sent or not. We have developed separate subVIs for obstacle, weed, and waypoint.

 

Diagonal Path Implementation

 To save the running time of robot in the course, going diagonally would be a necessary step. In the original A* algorithm, the next step from current location is only limited to up, down, left and right. But we have added up-right, up-left, down-right and down-left, so if there¡¯s no obstacle at up-left corner, and the robot can travel up and left (no obstacle in up and left direction), then the diagonal nodes will be pushed in to openset, and the robot could travel in up-left diagonal direction. Moreover, we¡¯ve modified the Manhattan distance calculation since the shortest distance is no longer an integer in tiles. If the next step is in diagonal, then that step distance is 1.414 tiles. Outside the course, we decide to skip the planned path and let the robot go to the destination directly, which is pathRow[0], pathCol[0], because there¡¯s no obstacle outside the course.

 

Vision Algorithm

The code for Vision Algorithm mostly reside in two places: First we have set the blue and pink HSV values in the ColorVision.c file so that the camera will constantly detect blue and pink almost simultaneously. The distance for detecting these was calibrated and the number of detected pixels to follow a color were also determined based on the view of the camera. Next, in RobotControl under the main c file, two robostates were created where robotstate=1 inspects the the number of blue/pink pixels, and the blue/pink distances.

 

Once the robot has detected either a blue weed or pink weed during its movement to waypoint,  it will first check if this weed has already been detected or not, based on the predicted location of the weed ( based on the current location of the robot and the location of the weed in the picture). If this is a new weed, and within the course, and the total weed is less than 5 and the number of each individual color of weed is less than 3, then the robot will enter robotstate=2. With the predicted location of the weed, the robot will go there directly and stay for 1 second. After that, it will rerun the A* algorithm to generate a new course map and enter robotstate 1 because it¡¯s already been deviated from original path.

Contest Results

First Round : #1 in the contest

https://youtu.be/0zFO4JYs6EE

 

Second Round : #2 in the contest

https://youtu.be/4sA_ONzuD8U

 

 

Group Members

Thomas Liu --- System Engineering and Design 2019  Honglu He --- Electrical Engineering 2019        Yukti Kathuria --- Aerospace Engineering 2018          Xiangyuan (Rocker) Zhang -- Computer Engineering 2020

445745392661103355

 

Source Code:

Source Code.zip